package com.sxbdjw.situation.bdjw.webrtc;

import org.webrtc.Logging;
import org.webrtc.VideoFrame;
import org.webrtc.VideoSink;

import kotlin.jvm.Synchronized;

public class ProxyVideoSink implements VideoSink {

    private String TAG = "ProxyVideoSink";
    private VideoSink target = null;


    @Override
    public void onFrame(VideoFrame frame) {
        if (target == null) {
            Logging.d(TAG, "Dropping frame in proxy because target is null.");
            return;
        }
        target.onFrame(frame);
    }

    @Synchronized
    public void setTarget(VideoSink target) {
        this.target = target;
    }
}
